package com.ruoyi.web.controller.information;

import com.github.pagehelper.PageInfo;
import com.jianqiao.information.information.domain.ArticlesEntity;
import com.jianqiao.information.information.domain.vo.ArticlesDetailVo;
import com.jianqiao.information.information.service.ArticlesService;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * author: cyx
 * create: 2024/7/17 17:31
 **/
@RestController
@RequestMapping("/information/articles")
public class ArticlesController {
    @Autowired
    private ArticlesService articlesServiceImpl;

    @GetMapping("/selectArticleDetail")
    public AjaxResult selectArticleDetail(String id){
        ArticlesDetailVo articlesDetailVo = articlesServiceImpl.selectArticleDetail(id);
        return AjaxResult.success(articlesDetailVo);
    }

    @PostMapping("/list")
    public AjaxResult articlesList(@RequestBody Map<String ,Object> param){
        PageInfo<ArticlesEntity> articlesEntityPageInfo = articlesServiceImpl.selectArticlesList(param);
        return AjaxResult.success(articlesEntityPageInfo);
    }
}
